<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

const handleGoHome = () => {
  router.push('/')
}
</script>

<template>
  <div class="unauthorized-container">
    <a-result
      status="403"
      subtitle="抱歉，您暂时没有权限访问该页面"
    >
      <template #icon>
        <a-icon-exclamation-circle class="icon" />
      </template>

      <template #extra>
        <a-space :size="16">
          <a-button type="primary" @click="handleGoHome">
            返回首页
          </a-button>
          <a-button type="outline">
            申请权限
          </a-button>
        </a-space>
      </template>
    </a-result>
  </div>
</template>

<style scoped lang="less">
.unauthorized-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: var(--color-bg-2);

  :deep(.arco-result) {
    padding: 0;

    .icon {
      font-size: 64px;
      color: var(--color-text-3);
    }

    .arco-result-title {
      color: var(--color-text-1);
      font-weight: 500;
      font-size: 18px;
      margin-top: 16px;
    }

    .arco-result-subtitle {
      color: var(--color-text-3);
      font-size: 14px;
    }

    .arco-result-extra {
      margin-top: 24px;
    }
  }
}
</style>
